﻿<?php
mysql_connect("localhost", "root@localhost", "") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("apc_vote") or die(mysql_error());
echo "Connected to Database";

// Retrieve all the data from the "example" table
$result = mysql_query("SELECT * FROM Candidates")
or die(mysql_error());  


while($row = mysql_fetch_array( $result )){
 
echo "<table style='height: 165px; width: 483px' border='2'>";
echo "<tr>";
echo "<td style='width: 259px; height: 32px'>Name: ".$row['Cand_Name']."</td>";
echo "<td style='width: 212px' rowspan='4' ><img src='images/candidates/".$row['Cand_Num'].".png' width = '212' height = '248'></td></tr>";

echo "<tr><td style='width: 259px; height: 41px'>Party: ".$row['Cand_Party']."</td></tr>";

echo "<tr><td style='width: 259px; height: 41px'>Platform:</td></tr>";

echo "<tr><td style='width: 259px; height: 130px'><font face='Times New Roman'><textarea style='height: 124px; width: 254px'>";

echo $row['Cand_Platform']."</textarea></font></td></tr></table><br>";


}
?>